<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
session_start(); //we need to call PHP's session object to access it through CI

class Home extends CI_Controller {
	
	function __construct(){
		parent::__construct();
		
		$index	= $this->config->item('index_page');
		$host	= $this->config->item('base_url');

		$this->url = empty($index) ? $host : $host . $index . '/';
		$this->user	= unserialize(base64_decode($this->session->userdata('user')));		

//		$this->load->model('mHome');
		
	}
	
	public function index(){
		if (!empty($this->user)){
//		 $view['username'] = $session_data['username'];
		$param['url'] = $this->url;
		$view['user'] = $this->user['username'];
		$view['header'] = $this->load->view('admin/header/header', $param, true);
		$view['menu'] = $this->load->view('admin/menu/menu', $param, true);
		$view['content'] = $this->load->view('admin/rcontent/home/home', $view, true);
		$this->load->view('index', $view);
		}
	   else
	   {
		 //If no session, redirect to login page
		 redirect('admin/login');
	   }

	}

	
}